<template>
  <el-table :height="calTableHeight() - 50" ref="TableRef" :data="data">
    <el-table-column type="index" :label="$t('序号')" width="60" align="center" />

    <el-table-column show-overflow-tooltip width="200" :label="$t('sku编号')" align="center" prop="skuNo" />

    <el-table-column show-overflow-tooltip width="200" :label="$t('sku名字')" align="center" prop="skuName" />

    <el-table-column
      show-overflow-tooltip
      width="200"
      :label="$t('申请时价格')"
      align="center"
      prop="applyPrice">
      <template slot-scope="{ row }">
        <span>{{ row.applyPrice ? (+row.applyPrice).toFixed() : '' }}</span>
      </template>
    </el-table-column>

    <el-table-column
      show-overflow-tooltip
      width="200"
      :label="$t('申请数量')"
      align="center"
      prop="applyNum" />
    <el-table-column show-overflow-tooltip :label="$t('提前付款数量')" align="center" prop="remark" />
  </el-table>
</template>
<script>
import handleTableSum from '@/utils/handleSum'

export default {
  activated() {
    this.$nextTick(() => this.$refs['TableRef']?.doLayout())
  },
  props: {
    /**
     * data
     */
    data: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {}
  },
  methods: {
    handleSum(param) {
      /**
       * 需要进行统计的字段
       */
      const data = handleTableSum(param, [])
      console.log(`data ==>`, JSON.parse(JSON.stringify(data)))
      return data
    },

    cancel() {
      this.$emit('update:show', false)
    },
  },
}
</script>
